feat(api): Make ComponentLike extends ComponentBuilderApplicable#1166
feat(api): Make ComponentLike extends ComponentBuilderApplicable#1166indyteo wants to merge 1 commit into
Conversation
|
I'm unsure if it's best to do this, or adapt |
|
The only way we'd be able to do this (allow usage of ComponentLike in LinearComponents alongside style elements) is allowing an |
Technically, we could add another interface above to both |
5a5e60d to
7d27812
Compare
Strokkur424
left a comment
There was a problem hiding this comment.
Needs a rebase for main/5
This PR make the
ComponentLikeinterface extendsComponentBuilderApplicable.The main advantage of doing so is to allow using
ComponentLikes in theLinearComponents#linearmethod. Imagine something in the lines of:With
playerandrewardbeing instances of a class that declares itselfComponentLike. It would be very clear syntax! Actually, we need to add.asComponent()so it takes away unnecessarily a bit of readability, I think.Overall, I feel this serves well the purpose of
LinearComponents#linearbeing to reduce the verbosity of declaring a succession of components.Side note about the
FunctionalInterfaceMethodChangedwarning, I suppressed it after discussing about it on Discord here.Thanks!